<template>
  <div class="nav-design flex-column" v-loading="loading">
    <el-form :model="form" :rules="rules" :label-width="100">
      <el-form-item label="导航名称" prop="user">
        <el-input class="width-100" clearable placeholder="请输入"></el-input>
      </el-form-item>
      <br />
      <div class="form-action text-center">
        <el-button @click="cancel">取消</el-button>
        <el-button type="primary" @click="save">确认</el-button>
      </div>
    </el-form>
  </div>
</template>

<script>
import BaseComponent from "@/application/BaseComponent.vue";

export default {
  extends: BaseComponent,
  name: "NavDesign",
  props: ["design"],
  emits: ["close"],
  data() {
    return {
      options: [
        { label: "张三", value: "张三" },
        { label: "张三1", value: "张三1" },
        { label: "张三2", value: "张三2" },
        { label: "张三3", value: "张三3" }
      ],
      loading: false,
      form: this.design || {},
      rules: [],
      g: [
        {
          name: "数字员工",
          children: [
            { name: "数字状态", children: [] },
            { name: "工作记录", children: [] }
          ]
        }
      ]
    };
  },
  computed: {
    checkAll() {
      return 0;
    },
    groups() {
      return [
        {
          name: "数字员工",
          children: [
            { name: "数字状态", children: [] },
            { name: "工作记录", children: [] }
          ]
        }
      ];
    }
  },
  created() {
    // this.getData();
  },

  methods: {
    isIndeterminate() {},
    handleCheckAllChange() {},
    cancel() {
      this.$emit(`close`);
    },
    save() {
      this.loading = true;
      this.$g.ajax.$api("member.save", this.form).then((result) => {
        console.log(result);
        this.loading = false;
        this.$g.toast(result.message, result.code == 0 ? "success" : "error");
        this.cancel();
      });
    }
  }
};
</script>
<style>
.nav-design {
}
.card-permission {
  width: 100%;
}
.card-permission .el-card {
  background-color: rgb(246, 246, 246);
  width: 49%;
  padding: 10px;
}
</style>
